#ifndef rotate_h
#define rotate_h

template <class T>
void rotate(T* beg,T* end)
{
 if(beg==end)return;
 T el;
 T* p;
 p=end;--p;
 el=*p;
 --p;--end;
 for(;end!=beg;--p,--end)
 {
  *end=*p;
 }
 *beg=el;
}
template <class T>
void irotate(T* beg,T* end)
{
 T el;
 T* p;
 p=beg;++p;
 el=*beg;
 for(;end!=p;++p,++beg)
 {
  *beg=*p;
 }
 *p=el;
}
#endif
